package com.liu;
/*蛇的每一结，
    采用双向链表

* */
import java.awt.*;
public class Node {
    int row ,col;


    Node prev,next; //默认为空

    public Node(int row, int col) {
        this.row = row;
        this.col = col;
    }

    public void paint(Graphics g) {
        int x =Yard.x +col * Yard.NodeSize;//画笔的起始位置x， (Yard.NodeSize  间隔)
        int y = Yard.y +row * Yard.NodeSize;//画的起始位置y
        Color c= g.getColor();//先把原来那个颜色拿出来，保存一下现场，之后再恢复现场
        g.setColor(Color.BLACK);//给先小方格设置颜色
        g.fillRect(x,y,Yard.NodeSize,Yard.NodeSize);//画方块
        g.setColor(c);
    }
}
